import Vue from 'vue'
import axios from "axios";
//配置请求的根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// 请求拦截器，为每一个请求添加请求头,隐藏进度条
axios.interceptors.request.use(config => {
    config.headers.Authorization = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjUwMCwicmlkIjowLCJpYXQiOjE2NjgzMzM2MzksImV4cCI6MTY2ODQyMDAzOX0.nlAllmn9bw3j07Ur0ICZMOVBKYoT1Zi9PhocjmG4GOI"
    return config
})
export default axios
// 每一个this组件都可以通过this.$http来发起请求
Vue.prototype.$http = axios
